package kr.hkit.powerjava.chapter06;

public class GuguDan {
	public static void main(String[] args){

		infiniteLoop();
/*		calGuguDan(); //오버로딩	
		int dan = 2;
		while(dan <10){
			calGuguDan(dan);
			dan++;
		}
		calReverseGuguDan();	*/
}
	
	
	
	
	
	private static void infiniteLoop() {
		int i = 0;
		while(true){
			System.out.println("ㅎㅎㅎㅎㅎ");
			if(i==5)break; //while 루프를 벗어난다
			i++;
		}
	}





	private static void calGuguDan() {
		int i=1;
		
		while(i<10){
			i++;
			System.out.printf("%2d * %2d = %2d %n", 2, i, 2*i);
			
		}
	}
	
	

	private static void calGuguDan(int dan) {
		int i = 1;
		System.out.println("=========="+ dan+ "==========");
		while(i<10){
			System.out.printf("%2d * %2d = %2d %n", dan, i, dan*i);
			i++;
		}
		System.out.println();
	}

	private static void calReverseGuguDan() {
		int i = 9;
		
		while (i>0){
			System.out.printf("%2d * %2d = %2d %n", 2, i, 2*i);
			i--;
		}	
		System.out.println();
	}


}
